package tk.mynoteapp.dev.demo22.config;

import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import tk.mynoteapp.dev.demo22.headerapiversion.APIVersionHeaderHandlerMapping;

@Configuration
public class WebMvcRegistrationsConfig implements WebMvcRegistrations {
    @Override
    public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
//        return new APIVersionHandlerMapping(); // 链接形式，如：/v1/api/user
        return new APIVersionHeaderHandlerMapping(); // 请求头形式，如：X-API-VERSION=v1
    }


}
